home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc / Developer Documentation / Recipes, Tech Notes & Articles / Tech Notes / Detecting bad 'nmap's < prev    next >
Encoding:
Text File  |  1996-07-19  |  2.4 KB  |  38 lines  |  [TEXT/ttxt]

  1. How to detect bad/corrupted 'nmap's
  2.  
  3. Copyright ©1995, 1996 Apple Computer, Inc.
  4.  
  5. Much of this material, except for code examples, has been incorporated into the OpenDoc Programmer's Guide for the Mac OS, published by Addison-Wesley.
  6.  
  7. Bad or corrupted 'nmap' resources can cause significant trouble when running OpenDoc™.  Here's how to recognize the signs of a bad 'nmap' situation and verify that that's what it is.
  8.  
  9. If you're running the debug build of OpenDoc, bad 'nmap' problems are pretty easy to spot:  upon launching a part, any part, you'll get a series of memory warnings, such as "address looks weird," or "violates block."  Yet if you keep going long enough your part will (usually) run anyway.
  10.  
  11. What's happening is that one or more bad 'nmap' resources are causing an ODNameSpace object to write data to unlikely or impossible locations.  Most importantly, because every editor's 'nmap's contribute to the name space, the faulty editor may not even be the one you're running.
  12.  
  13. Because of this, it's important to be able to recognize and diagnose bad 'nmap' situations, and, at the very least, remove the offending editor(s) from your Editors folder so that you can run the remainder of your editors in peace.
  14.  
  15. Testing your 'nmap's
  16.  
  17. Use the MPW tool "Derez" to Rez disassemble the resource fork of your part editor.  Be sure to specify:
  18.   • only 'nmap' resources,
  19.   • ODTypes.r as the template file
  20.   • and the OpenDoc Rez Includes directories as include paths. 
  21.  
  22. E.g.:
  23.  
  24.   Derez -only 'nmap' "SomeEditor.rsrc" "{ODRIncludes}ODTypes.r" -i "{ODRIncludes}"
  25.  
  26. where ODRIncludes is an MPW shell variable the developer is responsible for setting to the location of their RIncludes for OpenDoc.
  27.  
  28. All the resulting entries should start with something like 
  29.   resource 'nmap'
  30. If you see one which starts with
  31.   data 'nmap'
  32. then you know you have found a bad 'nmap'.  
  33.  
  34. If an editor with such an 'nmap' is installed, then NONE of the other installed editors will work because the NamespaceManager fails when trying to read the bad 'nmap'.  Please remove or deinstall any and all part editors which you find have bad 'nmap's.  This may happen as a result of manipulating the 'nmap's with ResEdit or some other utility.  
  35.  
  36. Fixing bad 'nmap's
  37.  
  38. The only currently supported way to alter 'nmap's is to use MPW to modify the appropriate .r file and then Rez the .r file into a .rsrc file.  Please see the Sample Code and Recipes for instructions on how to do this.